package cn.com.fuhuitong.main.mine.adapter

import android.annotation.SuppressLint
import android.content.Context
import android.view.View
import cn.com.fuhuitong.R
import cn.com.fuhuitong.base.BaseDelegateAdapter
import cn.com.fuhuitong.main.ItemViewType
import cn.com.fuhuitong.main.mine.entity.IncomeList
import com.alibaba.android.vlayout.LayoutHelper
import com.blankj.utilcode.util.TimeUtils
import kotlinx.android.synthetic.main.item_mine_income.view.*


class IncomeListAdapter(
    private val mContext: Context, private val mHelper: LayoutHelper
) : BaseDelegateAdapter<IncomeList>(
    mContext = mContext,
    mHelper = mHelper,
    mLayoutId = R.layout.item_mine_income,
    mItemViewType = ItemViewType.SHARE_LIST
) {
    @SuppressLint("SetTextI18n")
    override fun onBindViewHolder(itemView: View, position: Int, itemData: IncomeList) {
        super.onBindViewHolder(itemView, position, itemData)
        itemView.text_income_name.text = itemData.nickname
        itemView.text_income_time.text =
            TimeUtils.millis2String((itemData.createtime * 1000), "yyyy-MM-dd")
        itemView.text_income_count.text = itemData.goods_num
    }
}